package com.mew.chess.core.game.yxx.game.message;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;


@Data
@ToString
@NoArgsConstructor
public class YxxPushPaymentMessage extends ZebraBaseMessage<YxxPushPaymentMessage> {

    private int remainTime;

    private YxxPaymentMessage paymentMessage; //negative lose; positive win
    private YxxHistoryMessage historyMessage = new YxxHistoryMessage();

    private long paymentNumber = -1; //当前赔付金额 （-1表示没有参与本局）
    private long goldNumber; //current user goldNumber

    private List<YxxUserMessage> bigRList = new ArrayList<>();

    @Override
    public void write(ByteBuf b) {

        writeInt(b, this.remainTime);
        paymentMessage.writeMsg(b);
        historyMessage.writeMsg(b);

        writeLong(b, this.paymentNumber);
        writeLong(b, this.goldNumber);

        writeInt(b,bigRList.size());
        for (YxxUserMessage yxxUserMessage : bigRList) {
            yxxUserMessage.write(b);
        }
    }

    @Override
    public YxxPushPaymentMessage read(ByteBuf b) {

        return null;
    }


}
